

# 第77题. 组合


def main(n,k):
    result = []
    temp = []
    def backtrack(n,k,startIndex):
        if(len(temp)==k):
            result.append(temp[:])
            return
        for i in range(startIndex,n+1-(k-len(temp))+1):
            temp.append(i)
            backtrack(n,k,i+1)
            temp.pop()
    backtrack(n,k,1)
    return result

if __name__ == "__main__":
    n = int(input())
    k = int(input())
    result = main(n,k)
    print(result)
